import request from '@/utils/request.js'

const prevUrl = '/department/';

export default {

    // 查询列表
    list(companyId) {
        const params = {
            companyId: companyId
        }
        return request({
            url: `${prevUrl}list`,
            method: 'post',
            data: {},
            params: params
        })
    },
    // 查询明细
    getDetail(id) {
        return request({
            url: `${prevUrl}${id}`,
            method: 'get'
        })
    },
    // 新增
    add(data) {
        return request({
            url: `${prevUrl}`,
            method: 'post',
            data: data
        })
    },
    // 修改
    update(data) {
        return request({
            url: `${prevUrl}`,
            method: 'put',
            data: data
        })
    },
    // 删除
    del(id) {
        return request({
            url: `${prevUrl}${id}`,
            method: 'delete'
        })
    },
    // 导出
    export(query) {
        return request({
            url: `${prevUrl}export`,
            method: 'get',
            params: query
        })
    }
}

